package me.hl.aspectJ;


import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * Created by Planck on 2016/1/28.
 */

@Aspect
@Component
public class AdvisorJAopTest {

    @Pointcut("execution(* *.sleep())")
    public void sleeppoint(){}

    @Before("sleeppoint()")
    public void beforeSleep(){
        System.out.println("AdvisorJAopTest before sleep");
    }

    @AfterReturning("sleeppoint()")
    public void afterSleep(){
        System.out.println("AdvisorJAopTest after sleep");
    }



}
